<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * 权限信息数据模型
 *
 * Date: 19/03/2018
 * @author George
 * @package App\Models
 */
class Permission extends Model
{
	/**
	 * 禁用created_at和updated_at字段
	 *
	 * @var bool
	 * Date: 21/03/2018
	 * @author George
	 */
	public $timestamps = false;

	/**
	 * 禁用自增
	 *
	 * @var bool
	 * Date: 17/04/2018
	 * @author George
	 */
	public $incrementing = false;

	/**
	 * 获取权限关联的模型
	 *
	 * Date: 29/04/2018
	 * @author George
	 * @return \Illuminate\Database\Eloquent\Relations\MorphTo
	 */
	public function permissiontable()
	{
		return $this->morphTo('permissiontable', 'permissiontable_type' ,'permissiontable_code', 'code');
	}
}
